{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib\n",
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import string\n",
    "#https://stackoverflow.com/questions/19726663/how-to-save-the-pandas-dataframe-series-data-as-a-figure\n",
    "import six\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "tbpath = \"../../fits/\"\n",
    "productpath = \"../../postfit_derivatives/\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "models = [\"fulllinearmodel_fit_table.csv\",\"reducedlinearmodelNegBinom_fit_table.csv\",\n",
    "          \"reducedlinearmodelq0_fit_table.csv\",\"reducedlinearmodelq0ctime_fit_table.csv\",\n",
    "         \"nonlinearmodelq0ctime_fit_table.csv\",\"nonlinearmodel_fit_table.csv\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "rois = []\n",
    "for model in models:\n",
    "    df = pd.read_csv(tbpath + model) #get rois in all tables (some may have failed)\n",
    "    rois += list(df.roi.unique())\n",
    "\n",
    "    \n",
    "rois = list(set(rois))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "theta_ = [\"beta\"]#,\"Rlast\"] #need to update Rlast\n",
    "\n",
    "\n",
    "dfreport = pd.DataFrame(columns=['Region', 'Model','median '+theta_[0],'CI lower','CI upper'])#,'median '+theta_[1],'CI lower','CI upper'])\n",
    "k = -1\n",
    "for roi in rois:\n",
    "    try:\n",
    "        k += 1\n",
    "        model = \"fulllinearmodel_fit_table.csv\" \n",
    "        df = pd.read_csv(tbpath + model)\n",
    "        theta = theta_[0]\n",
    "        measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "        measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "        measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "        x = [roi,model.split('_fit_table.csv')[0],np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "    #         theta = theta_[1]\n",
    "    #         measure1 = df.loc[(df.roi==roi)&(df['quantile']==0.5),theta].values[0]\n",
    "    #         measure2 = df.loc[(df.roi==roi)&(df['quantile']==0.025),theta].values[0]\n",
    "    #         measure3 = df.loc[(df.roi==roi)&(df['quantile']==0.975),theta].values[0]\n",
    "    #         x += [np.round(measure1,4),np.round(measure2,4),np.round(measure3,4)]\n",
    "        dfreport.loc[k] = x\n",
    "    except:\n",
    "        print(roi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.44235\n",
      "0.025    0.189805\n",
      "0.500    0.442350\n",
      "0.975    0.931658\n",
      "Name: median beta, dtype: float64\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA1MAAAE2CAYAAACEHshcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deVyVZf7/8fcFB0RccddcwI3S3ErF+pkhMWrllFlZuYWYpVk5bqUtiqlJi9moY05TLqk1LrlkaamhjuNoqel3ZnKpHm5l5r6gYIjevz8OnAE5Kl4HOoCv5+NxHkfu+z73+Ry4PJw313Ibx3EEAAAAALg2Af4uAAAAAAAKI8IUAAAAAFggTAEAAACABcIUAAAAAFggTAEAAACABcIUAAAAAFhwXWU/66YD+F1ER7vv16zxZxUAAAA5mMvtoGcKAAAAACwQpgAAAADAAmEKA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m+//VYLFixQnz591LNnT61evVoTJ07Uf//7X61cuVIBAe6+klOnTun222/X/v37FR8fr4YNG+rgwYOaMmWKoqKitHnzZtWqVUudO3fWwYMH9d577+nFF1/UTTfdJEmqU6eOJOnAgQN6//339eCDD6pr165yuVxau3at3njjDW3dulVffvllruouqozjOFfaf8WdQFE0bdUuf5dQ6MTHRvp8juho9/2aNT6fCgCKjB07dng+3BZlM2bMUK9evdSsWTNt3LjRE0I+/fRT3X///XK5XNqwYYOaN28uyR1katWqpfDwcG3YsEGSdO7cOYWHh6t+/fpKSkrKdrHjCRMmaNCgQVq9erWio6N14cIFRUREKCUlRTt37lSFChUkuQNI48aNtX//fk2fPt3TO7NmzRq1bds22zbHcXTu3DkVL14822v54IMP9MQTT2ju3Lnq0qWLJHfPVEREhEJDQ/Xdd9955iU5jqNGjRrp2LFjOnjw4FW/T5nXRVq0aJE6derk2T5gwABNnDhRH3/8sR599FHPtvfee08bN25UkyZNPMfu27dPjRo1UufOnT09bZnf/8zvT1ZpaWkyxuSYL/bKK69ozJgx+vrrr9WyZcur1l5Q5fL/2GUvSEXPFAAAQCHzpz9J27b5u4rsmjaV3nnHt3P069cvW2/OHXfcIUmKioryBClJCg4OVsuWLbV+/XrPtpUrV+rQoUMaN26cTp48me2899xzjwYNGqQVK1YoOjpaW7Zs0U8//aQhQ4Z4gpQklSlTRn379s1VL5ExxhOkLly4oOTkZKWnpysmJkaS9PXXX3vCVKZOnTplW+DBGKO2bdtq8uTJOnPmjEqWLHnV542MjMwWpCR3j97EiRO1aNEiPfroo3IcR3PmzFGbNm10ww036OjRo55jS5QooVatWmnFihVXfS5J2X4e6enpSk5O1oULFxQbG1skwpSvCFMAAAAoEGrXrp3t67CwMElSREREjmPDwsKyzU3asWOHJCk+Pv6y5z906JAkeeYM3XjjjTmOadCgQa7rnTdvnsaPH6+tW7fmmGt14sSJHMdf+vokqXz58pKkY8eO5SpMeetFqVq1qsqWLet5XUeOHNGxY8e0YsUKVaxY0et5MocD5saUKVM0depUfffdd7p48WK2fd5e5/WEMAUAAFDI+NoDVFAFBgZe0/asMqeuvPnmm2ratKnXY6pVq2Zf3CUWLlyoRx55RC1bttSf//xn1ahRQyEhIbpw4YI6dOiQI3RIV34dV5l6c00yzxUbG6sXXnjBp3O9/fbbGjx4sNq1a6fnnntO1apVU3BwsA4cOKC4uDivr/N6QpgCAABAoVevXj1J7mFssbGxVzw2s4do586dOfZt3749V883a9YshYSEaPXq1QoNDfVs93bOvJTZA5fVwYMHdfLkSc/rqlixosqWLavTp09f9Xsh/W8uljezZs1SeHi4li9fnq0364svvrCovuhhaXQAAAAUeu3bt1elSpWUmJio48eP59ifmpqq5ORkSdKtt96q6tWra/r06dnmE50+fVpTp07N1fMFBgbKGJOtZ8ZxHI0ZM8bHV3Jlu3bt0uLFi7Nte/311yXJM5cqICBA3bp10zfffKMFCxZ4Pc/hw4c9/84cXujt+5b5OrP2nKWnpysxMdG3F1JE0DMFAACAQq9EiRL68MMP1alTJ0VGRio+Pl5169bVyZMntXPnTi1cuFCLFi1SdHS0AgMDNWHCBHXp0kUtW7ZUnz595HK5NG3aNJUvX1779++/6vM99NBD+uSTTxQTE6OePXvq/PnzWrx4cb5fe6lRo0bq3r27+vTpo3r16mn16tVasGCB7rzzTj3yyCOe48aOHav169erS5cu6tKli1q1aqXg4GDt27dPy5Yt06233upZza9FixYKCAjQ2LFjdeLECZUoUUIRERGKiorSQw89pOHDh+vuu+9W586ddfr0aX300Uc5Vve7XhGmAAAAUCS0b99emzZtUmJiombPnq0jR44oLCxMderU0aBBg9S4cWPPsQ899JAWLFigV199VQkJCapUqZLi4uLUpk0btWvX7qrP9eijjyo5OVkTJkzQkCFDFBYWpj/+8Y9KTEz0LCqRH2655Ra9/fbbeumllzR16lSVLl1azzzzjF577bVsw/DKlCmj9evXa/z48Zo3b56WLFkil8ul6tWrq3Xr1nriiSc8x9asWVPTpk3T66+/rn79+un8+fN6/PHHFRUVpaFDh8pxHH3wwQcaMGCAqlSpokceeUS9ev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nrqqSuec8+ePbrjjjv022+/6ZlnnlGNGjW0dOlSdejQwevxL7/8ssaOHasOHTpo9OjRCggI0KJFi/Twww9r8uTJ6t+/f66+d5MmTdKvv/6qp556SqVKldLHH3+s5557TsePH88WFrds2aKYmBiVLVtWTz31lG644Qb93//9nyZOnKj169dr7dq1CgoK0ksvvaSLFy9q3bp1mjVrlufxt99+uyR3mP3HP/6hjh07KiIiQmfPntX8+fPVp08fHTlyRMOHD89V3b4gTAEAAKBASE1N1datW7MN7Tt37px69+6tqKgoJSUleYa0PfXUU2rSpIkGDRqkNWvWKDo6Wunp6Ro0aJAqVqyob775RmFhYZKkfv36qXHjxrmqYcaMGVq/fr2GDh2arXcpNjZWHTt21PDhw7N9sJek/fv3a8eOHSpTpowkKT4+XrVq1dKkSZOuGqYkKSYmRjNnzlRKSopCQ0O1ceNGpaSkqHv37lqyZInS09Plcrm0du1aXbhwQTExMVc830svvaQTJ04oKSlJbdu2lST1799fnTt31tatW7Md++2332rs2LEaPny4XnvtNc/25557Tp06ddLw4cPVs2dPlSpV6qqv4/vvv9eOHTs8YbN///5q3bq1xowZo969e3u2x8fHq2rVqtq0aVO28951113q3Lmz5syZo7i4OP3hD3/QnDlztG7dOnXv3j3H8/Xo0UN9+/bNtm3gwIGKiYlRYmKihgwZku/z4RjmBwAAgAKhX79+OeZIrVy5UocOHVKvXr108uRJHT161HO75557JEkrVqyQ5O7x+OWXXxQXF+cJUpJUsmTJHB+6L2fRokUKCAjI0atx7733qmnTplqyZIkuXryYbV+vXr08QUqSQkND1apVK/3www+5es6YmBidP39e69atkyQlJSWpUqVKGjBggJKTk7Vp0yZJ0urVq2WM8QQkby5evKilS5eqefPm2Y4zxuj555/PcfycOXNkjNHjjz+e7Xt79OhR3XfffUpOTtaGDRty9Tq6deuWrdcuODhYAwcOVHp6uqdn8D//+Y/+/e9/q2vXrvrtt9+yPV/r1q1VokQJz8/zakqUKOH597lz53Ts2DEdP35c7dq10+nTp7Vz585cnccX9EwBAACgQKh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QBAAoLwhQAoKBoInqlAACFCAtQAAAAAIAFeqYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAsEKYAAAAAwAJhCgAAAAAs/H8l7FM00PcblAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "font = {'family' : 'sans-serif',\n",
    "        'weight' : 'normal',\n",
    "        'size'   : 18}\n",
    "\n",
    "matplotlib.rc('font', **font)\n",
    "\n",
    "\n",
    "def simpleaxis(ax):\n",
    "    ax.spines['top'].set_visible(False)\n",
    "    ax.spines['bottom'].set_visible(False)\n",
    "    ax.spines['right'].set_visible(False)\n",
    "    ax.spines['left'].set_visible(False)\n",
    "\n",
    "c_ = sns.color_palette('Blues')\n",
    "f,ax = plt.subplots(1,1,figsize=(15,5))\n",
    "\n",
    "## R0\n",
    "sns.distplot(dfreport['median beta'],color=c_[5],ax=ax, kde=False, norm_hist=True, label='region-wide beta')\n",
    "mu = np.median(dfreport['median beta'].values)\n",
    "print(mu)\n",
    "ax.axvline(mu,color='b',label='median beta')\n",
    "print(dfreport['median beta'].quantile(q=[0.025,0.5,0.975]))\n",
    "\n",
    "## Rlast\n",
    "# sns.distplot(dfreport['median R0'],color=c_[1],ax=ax, kde=False, norm_hist=True,label='region-wide April 15th, 2020')\n",
    "# mu = np.median(dfreport['median Rlast'].values)\n",
    "# print(mu)\n",
    "# ax.axvline(mu,color='b',alpha=0.5,label='median April 15th, 2020')\n",
    "# print(dfreport['median Rlast'].quantiles(q=[0.025,0.5,97.5]))\n",
    "\n",
    "\n",
    "plt.legend()\n",
    "simpleaxis(ax)\n",
    "ax.get_yaxis().set_visible(False)\n",
    "ax.set_xlabel('')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.1)\n",
    "ax.set_xlabel(r'$\\beta$')\n",
    "plt.subplots_adjust(hspace=0.5,bottom=0.2)\n",
    "plt.savefig(productpath + 'beta.png')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
